package day14;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException {
        Socket client = new Socket("192.168.9.11",9999);
        OutputStream os = client.getOutputStream();//向服务端写数据
        Scanner sc = new Scanner(System.in);//表示数据的来源
        while (true){
            System.out.println("请输入你要向服务端写入的数据：");
            String msg = sc.nextLine();
            os.write((msg+"\n").getBytes());
        }
    }
}
